﻿<%@ Page Title="Page History" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="History.aspx.cs" Inherits="Altairis.Sewen.WebApp.Sewen.History" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainCPH" runat="server">
    <asp:ListView runat="server" DataSourceID="HeaderObjectDataSource">
        <ItemTemplate>
            <h1 class="title">
                <asp:Literal Text='<%# Eval("Title", "History of page {0}") %>' runat="server" />
            </h1>
        </ItemTemplate>
    </asp:ListView>
    <asp:ObjectDataSource ID="HeaderObjectDataSource" runat="server" SelectMethod="LoadPage" TypeName="Altairis.Sewen.PageStoreManager">
        <SelectParameters>
            <asp:RouteParameter Name="name" RouteKey="slug" Type="String" DefaultValue="home-page" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ListView runat="server" DataSourceID="HistoryObjectDataSource">
        <LayoutTemplate>
            <div class="body">
                <table>
                    <thead>
                        <tr>
                            <th>Date</th>
                            <th>User</th>
                            <th>IP address</th>
                            <th>Comment</th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                    </tbody>
                </table>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>[<asp:HyperLink runat="server" NavigateUrl='<%# this.GetRouteUrl("SewenWikiPageVersion", new { slug = Eval("Slug"), version = Eval("Version", "{0:yyyyMMddHHmmssfff}"), exe = "delete" }) %>' Text="X" />]
                    <asp:HyperLink runat="server" NavigateUrl='<%# this.GetRouteUrl("SewenWikiPageVersion", new { slug = Eval("Slug"), version = Eval("Version", "{0:yyyyMMddHHmmssfff}") }) %>' Text='<%# Eval("Version", "{0:d} {0:T}") %>' />
                </td>
                <td>
                    <asp:Literal runat="server" Text='<%# Eval("UserName") %>' />
                </td>
                <td>
                    <asp:Literal runat="server" Text='<%# Eval("IpAddress") %>' />
                </td>
                <td>
                    <asp:Literal runat="server" Text='<%# Eval("Comment") %>' />
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <asp:ObjectDataSource ID="HistoryObjectDataSource" runat="server" SelectMethod="LoadPageVersions" TypeName="Altairis.Sewen.PageStoreManager">
        <SelectParameters>
            <asp:RouteParameter Name="name" RouteKey="slug" Type="String" DefaultValue="home-page" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
